package cn.yunbamboos.rest.service.filter;

import cn.yunbamboos.rest.service.RestServiceExchange;

/**
 * 服务过滤器
 * */
public interface RestServiceFilter extends Comparable<RestServiceFilter>{

    int order();

    void filter(RestServiceExchange exchange, FilterChain chain);

    default int compareTo(RestServiceFilter filter){
        return this.order() - filter.order();
    }
}
